﻿using System;
using System.Collections.Generic;

namespace Messhall.Application.Dto.Permissions.Responses;

public class PermissionTreeResponse:ResponseBase
{
    /// <summary>
    /// 父级权限
    /// </summary>
    public Guid ParentId { get; set; }

    /// <summary>
    /// 权限唯一CODE代码
    /// </summary>
    public string Code { get; set; }

    /// <summary>
    /// 权限名称
    /// </summary>
    public string Text { get; set; }

    /// <summary>
    /// URL规则
    /// </summary>
    public string Url { get; set; }

    /// <summary>
    /// 图标
    /// </summary>
    public string Icon { get; set; }

    /// <summary>
    /// 备注信息
    /// </summary>
    public string Remark { get; set; }

    /// <summary>
    /// 是否默认合起
    /// </summary>
    public bool IsCollapsed { get; set; } = false;

    /// <summary>
    /// 子集
    /// </summary>
    public List<PermissionTreeResponse> Items { get; set; } = new();

    #region 组件私有字段

    
    /// <summary>
    /// 树结构key
    /// </summary>
    public Guid Key => this.KeyId;
    
    /// <summary>
    /// 获得/设置 A 标签 target 参数 默认 null
    /// </summary>
    public string? Target => this.KeyId.ToString();

    #endregion
}